home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copy_Visible_Lines.bsh - Copies visible (non-folded) lines from
- * the current buffer to the clipboard.
- *
- * Copyright (C) 2002-2004 Ollie Rutherfurd <oliver@jedit.org>
- *
- * $Id: Copy_Visible_Lines.bsh,v 1.1 2004/08/03 21:31:47 orutherfurd Exp $
- */
-
- void copyVisibleLines(View view){
- JEditTextArea textArea = view.getTextArea();
- DisplayManager dm = textArea.getDisplayManager();
-
- StringBuffer buff = new StringBuffer();
- for(int i=0; i < buffer.getLineCount(); i++){
- if(dm.isLineVisible(i))
- buff.append(textArea.getLineText(i)).append('\n');
- }
- Registers.setRegister('$', buff.toString());
- }
-
- copyVisibleLines(view);
-
- /*
-
- <listitem>
- <para><filename>Copy_Visible_Lines.bsh</filename></para>
- <abstract><para>Copies the visible lines from the current
- buffer to the Clipboard. Lines that are not visible
- becuase they are folded are not copied.
- </para></abstract>
- </listitem>
-
- */
-